
package com.huaweicloud.saaslanding.install.config;

import com.huaweicloud.saaslanding.install.applicationservice.ServiceManageFrameService;
import com.huaweicloud.saaslanding.install.applicationservice.impl.CseServiceImpl;
import com.huaweicloud.saaslanding.install.applicationservice.impl.NacosServiceImpl;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 配置需要的服务管理平台
 *
 * @since 2022-10-27
 */
@Configuration
public class ServiceManageFrameworkConfiguration {

    @Bean
    @ConditionalOnProperty(name = "saaslanding-install.config-discovery-frame.type", havingValue = "nacos")
    public ServiceManageFrameService nacosService() {
        return new NacosServiceImpl();
    }

    @Bean
    @ConditionalOnProperty(name = "saaslanding-install.config-discovery-frame.type", havingValue = "cse")
    public ServiceManageFrameService cseService() {
        return new CseServiceImpl();
    }
}
